app.controller('cookDetailCtrl',['$scope','$location','CookApi',function($scope,$location,CookApi){
	$scope.coId = $location.search().co_id;
	CookApi.getRoleInfo().then(function(res){
        if(res.code == 200){
            $scope.role = res.result.role_tag;
        }
    });
	CookApi.cookInfo($scope.coId).then(function(res){
		if(res.code == 200) {
			$scope.cook = res.result;
		}
	});

	app.filter('genderFilter',function(){
	    return function(inputStr){
	        return inputStr == "MAN" ? '男' : '女';
	    }
	});
	app.filter('rankFilter',function(){
	    return function(inputStr){
	        switch(inputStr) {
	        	case 'SUPER':
	        	  return '特级';
	        	case 'ONE':
	        	  return '一级';
	        	case 'TWO':
	        	  return '二级';
	        	case 'THREE':
	        	  return '三级';
	        	case 'FOUR':
	        	  return '四级';
	        }
	        return '';
	    }
	});
	app.filter('authFilter',function(){
	    return function(inputStr){
	        return inputStr == "Y" ? '已认证' : '未认证';
	    }
	});
}])